﻿Namespace B1Objects
    Friend Class Items
        Implements B1Objects.IItems
        Private _SapItems As SAPbouiCOM.Items

        Sub New(ByVal SapItems As SAPbouiCOM.Items)
            _SapItems = SapItems
        End Sub

        Public Function Add(ByVal UID As String, ByVal Type As SAPbouiCOM.BoFormItemTypes) As SAPbouiCOM.Item Implements SAPbouiCOM.IItems.Add
            Return _SapItems.Add(UID, Type)
        End Function

        Public Overloads Function AddEx(ByVal UID As String, ByVal Type As SAPbouiCOM.BoFormItemTypes) As B1Objects.Item
            Return B1Objects.Item.NewItem(_SapItems.Add(UID, Type))
        End Function

        Public ReadOnly Property Count As Integer Implements SAPbouiCOM.IItems.Count
            Get
                Return _SapItems.Count
            End Get
        End Property

        Public Function Item(ByVal Index As Object) As SAPbouiCOM.Item Implements SAPbouiCOM.IItems.Item
            Return _SapItems.Item(Index)
        End Function

        Public Function ItemEx(ByVal Index As Object) As B1Objects.IItem Implements IItems.ItemEx
            Return B1Objects.Item.NewItem(_SapItems.Item(Index))
        End Function

        Private Function GetEnumerator() As System.Collections.IEnumerator Implements SAPbouiCOM.IItems.GetEnumerator
            Return Nothing
        End Function

        Private Function GetEnumeratorEx() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
            Return Nothing
        End Function
    End Class
End Namespace

